//
//  PKPublishShortVideoViewModel.swift
//  Panku
//
//  Created by mac on 2017/2/16.
//  Copyright © 2017年 Monster. All rights reserved.
//

import UIKit

class PKPublishShortVideoViewModel: NSObject {
    
    //滤镜选择
    private var titlesForSelectionList = ["1997","amaro","brannan","earlyBird","hefe","hudson","inkWell","lomofi","lordKelvin","nashville","normal","rise","sierra","sutro","toaster","valencia","walden","xProll"]
    
    //录制时长
    var seconds = ["10s","20s","30s"]
    
    func numberOfItemsForSelectionList() -> Int{
        return titlesForSelectionList.count
    }
    
    func titleForItemWith(index:Int) -> String{
        return titlesForSelectionList[index]
    }
    
    func filterWith(title:String) -> IFImageFilter{
        
        //TODO:后面改成反射来做 减少代码
        var filter:IFImageFilter?
        
        switch title {
        case "1997":
            filter = IF1977Filter()
        case "amaro":
            filter = IFAmaroFilter()
        case "brannan":
            filter = IFBrannanFilter()
        case "earlyBird":
            filter = IFEarlybirdFilter()
        case "hefe":
            filter = IFHefeFilter()
        case "hudson":
            filter = IFHudsonFilter()
        case "inkWell":
            filter = IFInkwellFilter()
        case "lomofi":
            filter = IFLomofiFilter()
        case "lordKelvin":
            filter = IFLordKelvinFilter()
        case "nashville":
            filter = IFNashvilleFilter()
        case "normal":
            filter = IFNormalFilter()
        case "rise":
            filter = IFRiseFilter()
        case "sierra":
            filter = IFSierraFilter()
        case "sutro":
            filter = IFSutroFilter()
        case "toaster":
            filter = IFSutroFilter()
        case "valencia":
            filter = IFValenciaFilter()
        case "walden":
            filter = IFWaldenFilter()
        case "xProll":
            filter = IFXproIIFilter()
        default:
            filter = IFImageFilter()
        }
        
        return filter!
    }
    
    //MARK: - pickerView相关
    func numberOfComponents() -> Int{
        return 1
    }
    
    func titleForRow(AtIndex:Int) -> String{
        return seconds[AtIndex]
    }
    
    func rowHeightForComponent() -> CGFloat{
        return 20
    }
    
    func numberOfRowsInComponent() -> Int{
        return seconds.count
    }
    
    func widthForComponent() -> CGFloat{
        return 44
    }
}
